﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Mirror;


public class Win_OnlinePlayerContol : NetworkBehaviour
{
    public GameObject floattingInfo;
    public GameObject nameText;

    private Material playerMteriaClone;//克隆玩家的材质 

    [SyncVar(hook = nameof(OnPlayerNameChanged))]
    private string playerName;

    private void OnPlayerNameChanged(string oldStr, string newStr)
    {

    }

    [Command]
    private void CmdSetupPlayer(string nameValue,Color colorValue)
    {
        playerName = nameValue;

    }

    public GameObject cam;
    // Start is called before the first frame update
    public override void OnStartLocalPlayer()
    {
        cam.SetActive(true);
    }
    private void Update()
    {
        if (!isLocalPlayer)
            return;
        var moveX = Input.GetAxis("Horizontal") * Time.deltaTime * 110f;
        var moveZ = Input.GetAxis("Vertical") * Time.deltaTime * 4.0f;

        transform.Rotate(0, moveX, 0);
        transform.Translate(0, 0, moveZ);
    }
}
